#include <iostream>
using namespace std;

class AbstractDrinking {
public:
    //煮水
    virtual void Boil() = 0;
    //冲泡
    virtual void Brew() = 0;
    //倒入杯中
    virtual void PourInCup() = 0;
    //加调料
    virtual void Putsomething() = 0;

    //制作饮品
    void MakeDrink() {
        Boil();
        Brew();
        PourInCup();
        Putsomething();
    }
};

//咖啡
class Coffee : public AbstractDrinking {
public:
    void Boil() {
        cout << "煮农夫山泉" << endl;
    }
    void Brew() {
        cout << "冲泡咖啡" << endl;
    }
    void PourInCup() {
        cout << "倒入杯中" << endl;
    }
    void Putsomething() {
        cout << "加糖和牛奶" << endl;
    }
};

//茶
class Tea : public AbstractDrinking {
public:
    void Boil() {
        cout << "煮水" << endl;
    }
    void Brew() {
        cout << "冲泡茶叶" << endl;
    }
    void PourInCup() {
        cout << "倒入陶瓷杯" << endl;
    }
    void Putsomething() {
        cout << "加枸杞和糖" << endl;
    }
};

void DoWork(AbstractDrinking * dw) {
    dw -> MakeDrink();
    delete dw;
}
int main() {
    DoWork(new Coffee);
    cout << "------------------" << endl;
    DoWork(new Tea);
    return 0;
}
